using System.Collections.Generic;

namespace Infralution.Localization.Wpf
{
	public class MarkupExtensionManager1
	{
		private List<ManagedMarkupExtension1> list_0 = new List<ManagedMarkupExtension1>();

		private int int_0;

		private int int_1 = 40;

		public List<ManagedMarkupExtension1> ActiveExtensions => list_0;

		public MarkupExtensionManager1(int cleanupInterval)
		{
			int_1 = cleanupInterval;
		}

		public virtual void UpdateAllTargets()
		{
			foreach (ManagedMarkupExtension1 item in list_0)
			{
				item.UpdateTargets();
			}
		}

		public void CleanupInactiveExtensions()
		{
			List<ManagedMarkupExtension1> list = new List<ManagedMarkupExtension1>(list_0.Count);
			foreach (ManagedMarkupExtension1 item in list_0)
			{
				if (item.IsTargetAlive)
				{
					list.Add(item);
				}
			}
			list_0 = list;
		}

		internal void method_0(ManagedMarkupExtension1 managedMarkupExtension1_0)
		{
			if (int_0 > int_1)
			{
				CleanupInactiveExtensions();
				int_0 = 0;
			}
			list_0.Add(managedMarkupExtension1_0);
			int_0++;
		}
	}
}
